package android.FiltrosJava;

public class Posterize extends PointFilter{
	public int[] computeFilter(int px, int py, int[] imageData){
		int hlrc = 0;
		for (int y=0; y < 3; y++){
			if (imageData[y] > hlrc)
				hlrc = imageData[y];				
		}
		
		for (int y=0; y < 3; y++){
			imageData[y] = (short) (imageData[y] - (imageData[y] * (255 - hlrc) / 255));			
		}
		return imageData;
	}
}
